export default {
    namespaced: true,
    state: {
        isShowToast: false,
        toastMsg: "我是提示框内容",
        toastType: "warning"
    },
    mutations: {
        changIsShowToast(state, payload) {
            // console.log("修改提示框状态");
            state.isShowToast = payload.isShow
            if (payload.isShow) {
                state.toastType = payload.type;
                state.toastMsg = payload.title;
            }
        }
    },
    actions: {
        asyncShowToast(context, payload) {
            context.commit("changIsShowToast", payload);
            setTimeout(() => {
                context.commit("changIsShowToast", {
                    isShow: false
                })
            }, 2000);
        }

    }
}